NAND flash memory, as well as other types of non-volatile memories (“NVMs”), are commonly used for mass storage. For example, consumer electronics such as portable media players often include flash memory to store music, videos, and other media.
NAND flash memory systems maintain a mapping of logical to physical addresses to permit a file system to write or read data from the NVM. The mapping may be required because the file system may provide read and write requests that are not directly compatible with NVM. For example, the logical addresses may use conventions or protocols typical of hard-drive-based systems. A hard-drive-based system, unlike flash memory, can overwrite a memory location without first performing a block erase. Moreover, hard drives may not need to perform operations such as wear leveling and garbage collection. Therefore, the overhead required in managing content stored in a NAND flash type of NVM can be greater than that of hard-drive based systems.
This is particularly evident in situations where the system has data stored in a file or database on the NVM, but that data is no longer needed. For example, the file can be a swap file or page file (used in connection with a virtual memory scheme) that has had data paged out. Once the data is paged in, and returned to main memory, it is no longer required to be stored in NVM. However, unless specific action is taken by the file system, the NVM manager is still required to manage that data because the swap file is still marked as allocated according to the file system. Absent any such file system action, the operating efficiency of the system can be reduced.